<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ChildSelect
 *
 * @author johnnypark
 */
class Application_Form_ChildSelect extends Zend_Form
{

    public function init()
    {
	$this->setMethod('post');

	$modelChild = new Model_Child;
	$this->addElement('select', 'child_id', array(
	    'MultiOptions' => $this->convertPersonsToSelectList($modelChild->listAllAktiv()),
	    'label' => 'Bitte wählen Sie das Kind'
	));

    }

    private function convertPersonsToSelectList($persons)
    {
	$selectPersons = array();
	foreach ($persons as $person)
	{
	    $selectPersons[$person['id']] = $person['forename'] . " " . $person['surname'];
	}
	return $selectPersons;
    }

}

?>
